<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>

<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<title>化妆品管理系统</title>
		<link rel="stylesheet" href="css/login.css">
		<script type="text/javascript" src="js/jquery.min.js"></script>
		<script type="text/javascript" src="js/index.js"></script>
		<script src="./lib/layui/layui.js" charset="utf-8"></script>
	</head>

	<body class="login-bg">
    <canvas id="fullstarbg">你的浏览器不支持canvas标签</canvas>
    <div class="login">
        <div class="message">化妆品系统注册</div>
        <div id="darkbannerwrap"></div>
        <form method="post" class="layui-form" onsubmit="return false;">
            <input name="username"id="username" placeholder="用户名" type="text" lay-verify="required" class="layui-input">
            <hr class="hr15">
            <input name="password" id="password" lay-verify="required" placeholder="密码" type="password" class="layui-input">
            <hr class="hr15">
            <input value="注册" lay-submit lay-filter="login" style="width:100%;" type="submit">
            <hr class="hr20">
        </form>
    </div>
    <script>
            layui.use(['form'],
            function() {
                $ = layui.jquery;
                var form = layui.form,
                layer = layui.layer;

                //监听提交
                form.on('submit(login)', function (data) {
                    //判定接口密码是否正确，决定是否跳转
                    //跳转
                    $.ajax({
                        url: "/wk3un7/userServlet?method=loginZhuCe",
                        method: "post",
                        data: {
                            username: $("#username").val(),
                            password: $("#password").val()
                        },
                        dataType: "json",
                        success: function (res) {
                            if (res.count>='1') {
                            	
                                window.location.href = "/wk3un7/backstage/index.jsp";
                                layer.msg("注册成功");
                            } else {
                                layer.msg(res.msg);
                            }

                          
                        },
                        error: function (e) {

                        }
                    });
					    //window.location.href = "index";
						return false;
					}
				);
            });

    </script>


    <!-- 底部结束 -->

</body>

</html>